﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using BCEntity.Common.DeviceInfo;

namespace BCData.Common.DeviceInfo
{
    public interface IDeviceInfoData
    {
        Task<DeviceInfoEntity> Create(DeviceInfoEntity entity);

        void UpdateAsync(DeviceInfoEntity entity);

        Task<IEnumerable<DeviceInfoEntity>> GetPushTokens(string appType, long userId, int days);

        Task<IEnumerable<DeviceInfoEntity>> GetPushTokens(string appType, long[] userIds, int days);

        Task<IEnumerable<DeviceInfoEntity>> GetDeviceInfosByAppTypeAndDeviceId(string appType, string osType, string model, string deviceId);

        /// <summary>
        /// 获取设备信息
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <returns></returns>
        Task<DeviceInfoEntity> Get(long userId);

        /// <summary>
        /// 设备信息详细列表
        /// </summary>
        /// <param name="phone">手机号</param>
        /// <param name="userName">姓名</param>
        /// <param name="role">角色</param>
        /// <param name="appType">应用类型</param>
        /// <param name="osType">操作系统类型</param>
        /// <param name="model">手机型号</param>
        /// <param name="deviceId">设备标识号</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">当前页面大小</param>
        /// <returns></returns>
        Task<(IEnumerable<DeviceInfoViewEntity>, int)> GetDeviceInfoViews(string phone, string userName, string role, string appType, string osType, string model, string deviceId, bool? ascending, int pageIndex, int pageSize);
    }
}
